package com.lwb.ztx.utils;

import android.content.Context;
import android.content.Intent;

import com.lwb.ztx.bean.NewsBean;
import com.lwb.ztx.news.widget.NewsDetailActivity;
import com.lwb.ztx.news.widget.NewsImageActivity;
import com.lwb.ztx.news.widget.NewsTopicActivity;

/**
 * Created by Administrator on 2016/5/29.
 */
public class ActivitySkipUtils {
    public static void readNews(Context mContext, NewsBean bean) {
        if(bean.getType().equals("shortNews")) {
            Intent intent = new Intent(mContext, NewsImageActivity.class);
            intent.putExtra("news", bean);
            mContext.startActivity(intent);
        } else if (bean.getType().equals("slide")) {
            Intent intent = new Intent(mContext, NewsImageActivity.class);
            intent.putExtra("news", bean);
            mContext.startActivity(intent);
        } else if (bean.getType().equals("topic2")) {
            Intent intent = new Intent(mContext, NewsTopicActivity.class);
            intent.putExtra("news", bean);
            mContext.startActivity(intent);
        }

        else {
            LogUtils.d(bean.toString());
            Intent intent = new Intent(mContext, NewsDetailActivity.class);
            intent.putExtra("news", bean);
            mContext.startActivity(intent);
        }
    }
}
